//
//  TextField_ImageView.m
//  HYTAPP
//
//  Created by 林建 on 17/7/21.
//  Copyright © 2017年 林建. All rights reserved.
//

#import "TextField_ImageView.h"

@implementation TextField_ImageView

-(instancetype)initWithFrame:(CGRect)frame left:(NSInteger)left right:(NSInteger)right imageLeft:(NSInteger)imageLeft{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        //内容
        self.ContextView = [UIImageView new];
        [self addSubview:self.ContextView];
        //输入框
        self.OutPutTF = [[UITextField alloc]init];
        [self  addSubview:self.OutPutTF];
        self.OutPutTF.textColor = Color.theme;
        self.OutPutTF.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
        
        [self.ContextView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.mas_centerY);
            make.left.mas_equalTo(self.mas_left).offset(left);
            make.width.mas_equalTo(22);
            make.height.mas_equalTo(26);
        }];
        [self.OutPutTF mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.mas_top).offset(1);
            make.left.mas_equalTo(self.ContextView.mas_right).offset(imageLeft);
            make.right.mas_equalTo(self.mas_right).offset(right);
            make.bottom.mas_equalTo(self.mas_bottom);
        }];
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
